<?php
/**
 * 收藏楼盘
 */
namespace Member\Controller;
use Org\Yike\Member;
class CollectionController extends CommonController {
    public function _initialize(){
        parent::_initialize();
        $this->is_login();
    }

    public function index(){
        $member = new Member();
        $list = $member::getCollectionList(20,'hc.user_id='.$this->user['id'],true);
        $this->list = $list;
        $this->seoKey(array('seo_title'=>'楼盘收藏列表'));
        $this->display();
    }

    public function del(){
        $res = M('house_collection')->where(array('id'=>intval($_GET['id']),'used_id'=>$this->user['id']))->delete();
        if($res){
            $this->success('取消收藏楼盘成功');
        }else{
            $this->error('取消收藏楼盘失败');
        }
    }

}